Skip to main content

hostNameToAddress

Type​

function

Summary​

Returns the IP addresses corresponding to a domain name.

Syntax​

the hostNameToAddress of <domainName>
hostNameToAddress(<domainName>, [<callback>])

Description​

Use the hostNameToAddress function to find the numeric IP address of the computer or computers at a given domain name.

If the callback parameter is specified then the call will return immediately and upon completion of the lookup, the callback will be invoked with the resolved address as a parameter.

Parameters​

NameTypeDescription

domainName

A standard fully-qualified domain name.

callback

The name of a message to send when the lookup completes.

Examples​

hostNameToAddress("mail.example.org")
put hostNameToAddress("www." & thisDomain) into line 3 of theHosts
hostNameToAddress("www.domain.com", myCallback)

Value​

NameTypeDescription

return

The hostNameToAddress function returns the IP addresses corresponding to the domain name, one per line.

the result

The hostNameToAddress function does a DNS lookup on the domain name in order to find the IP address. This means that the computer must be connected to the Internet in order to use this function. If a connection to the Internet is not available, the hostNameToAddress function returns an error message in the result function.

keyword: numeric

command: accept

control structure: function

function: result, DNSServers

glossary: DNS, domain name, IP address

Compatibility and Support​

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?